#include "AP_InertialSensor_Stub.h"
#include "AP_HAL_Sim.h"

AP_InertialSensor_Stub::AP_InertialSensor_Stub()
    : _accel(0, 0, 0), _gyro(0, 0, 0), _last_update_us(AP_HAL::micros64()) {
}

void AP_InertialSensor_Stub::set_accel(const Vector3f& accel) {
    _accel = accel;
}

void AP_InertialSensor_Stub::set_gyro(const Vector3f& gyro) {
    _gyro = gyro;
}

Vector3f AP_InertialSensor_Stub::get_accel() const {
    return _accel;
}

Vector3f AP_InertialSensor_Stub::get_gyro() const {
    return _gyro;
}

uint32_t AP_InertialSensor_Stub::get_delta_time_micros() const {
    uint64_t now = AP_HAL::micros64();
    uint32_t delta = now - _last_update_us;
    _last_update_us = now;
    return delta;
}